{% load i18n static menu_functions extra_functions %}

{% block ltemain-sidebar %}

  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
 <section class="sidebar" style="height: auto;">
	<div class="user-panel">
        <div class="pull-left image">
          {{user|userimage}}
        </div>
        <div class="pull-left info">
          <p>{% firstof user.get_short_name user.get_username %}</p>
          <!-- <a href="#"><i class="fa fa-circle text-success"></i> Online</a>-->
        </div>
    </div>
	<ul class="sidebar-menu">

	  {% get_menu request as apps %}

    {% if apps %}
      {% for app in apps %}
        <li class="treeview">
          <a href="{{ app.app_url }}" title="{% blocktrans with name=app.name %}Models in the {{ name }} application{% endblocktrans %}">
             <i class="fa fa-circle-o"></i> 
              <span style="max-width:76%;display:inline-block;overflow:hidden;vertical-align:middle;">
                {{ app.name }}
              </span>
              <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>

          </a>

        {% for model in app.models %}
          <ul class="treeview-menu">
            <li>
              <a href="{{ model.admin_url }}">
                <i class="fa {{ app|get_icon_class_from_model:model }}"></i>
                <span>{{ model.name }}</span>
              </a>
            </li>
          </ul>
        {% endfor %}


      </li>
	  {% endfor %}
    {% endif %}



	</ul>
 </section>
    <!-- /.sidebar -->
  </aside>
    {% endblock %}